package com.qyt.hotel.service.impl;

import com.qyt.hotel.dao.RoomMapper;
import com.qyt.hotel.entity.Room;
import com.qyt.hotel.entity.RoomState;
import com.qyt.hotel.service.RoomService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {

    @Resource
    private RoomMapper roomMapper;

    @Override
    public List<Room> getRoomList(Integer roomTypeId, Integer roomStateId) {
        return roomMapper.getRoomList(roomTypeId, roomStateId);
    }

    @Override
    public String getRoomId(String roomId) {
        return roomMapper.getRoomId(roomId);
    }

    @Override
    public Integer addRoom(Room room) {
        return roomMapper.addRoom(room);
    }

    @Override
    public Room getOne(String roomId) {
        return roomMapper.getOne(roomId);
    }

    @Override
    public Integer updateRoom(String id, String roomId, Integer roomStateId, Integer roomTypeId, String roomDescription) {
        return roomMapper.updateRoom(id, roomId, roomStateId, roomTypeId, roomDescription);
    }

    @Override
    public Integer deleteRoom(String roomId) {
        return roomMapper.deleteRoom(roomId);
    }
}
